import Annex.Content.Presence
import Annex.Ingest
import Types.KeySource
+import Types.Key
import Messages.Progress
import Logs.Location
+import Logs.EquivilantKeys
import Utility.Metered
import Backend.URL (fromUrl)
Nothing -> giveup "ingestion failed"
Just k -> do
logStatus NoLiveUpdate k InfoPresent
+ when (fromKey keyVariety k == VURLKey) $ do
+ hb <- hashBackend
+ void $ addEquivilantKey hb k
+ =<< calcRepo (gitAnnexLocation k)
return k
ldc = LockDownConfig
getEquivilantKeys,
setEquivilantKey,
updateEquivilantKeys,
+ addEquivilantKey,
generateEquivilantKey,
) where
addLog (Annex.Branch.RegardingUUID []) (equivilantKeysLogFile config key)
InfoPresent (LogInfo (serializeKey' equivkey))
--- The Backend must use a cryptographically secure hash.
---
-- This returns Verified when when an equivilant key has been added to the
-- log (or was already in the log). This is to avoid hashing the object
-- again later.
setEquivilantKey key ek
return (Just Verified)
+addEquivilantKey :: Backend -> Key -> OsPath -> Annex (Maybe Verification)
+addEquivilantKey b key obj =
+ updateEquivilantKeys b obj key
+ =<< getEquivilantKeys key
+
+-- The Backend must use a cryptographically secure hash.
generateEquivilantKey :: Backend -> OsPath -> Annex (Maybe Key)
generateEquivilantKey b obj =
case genKey b of
hb <- hashBackend
let updatevurl key getobj =
if (fromKey keyVariety key == VURLKey)
- then do
- obj <- getobj
- updateEquivilantKeys hb obj key
- =<< getEquivilantKeys key
+ then addEquivilantKey hb key =<< getobj
else return Nothing
let keyfile' = tmpdir </> keyfile
-* VURL keys don't currently have the hash key recorded in the equivilant
- key log by addcompute
-
* need progress bars for computations and implement PROGRESS message
* get input files for a computation (so `git-annex get .` gets every file,